package com.kefu.call.util;

import com.kefu.common.util.JacksonUtil;

import javax.servlet.http.HttpServletResponse;
import java.io.PrintWriter;

public class ResponseUtil {
    public static void responseJson(HttpServletResponse response, Object obj) {
        try {
            response.setContentType("application/json; charset=utf-8");
            PrintWriter out = response.getWriter();
            out.write(JacksonUtil.toString(obj));
            out.close();
        } catch (Exception e) {
            e.printStackTrace();
        }
    }
}
